from flask import Blueprint, request

user = Blueprint("user",__name__)

# 模块拦截器
@user.before_request
def before():
    if request.path.startswith("/v"):
        pass
    else:
        return "请登录"

@user.route("/user/add")
def add_user():
    return "添加用户成功"

@user.route("/user/update")
def update_user():
    return "更新用户成功"

@user.route("/v/user/info")
def info_user():
    n = None
    raise Exception("出错了")
    return "查看用户信息" + n
